<?php
 // 获取传过来的id
 $tid = $_GET['id'];

 if(isset($tid)){
    // 链接数据库
    $conn = mysqli_connect('127.0.0.1','root','123456','super','3306');
    // 设置查询编码
    mysqli_query($conn,'SET  NAMES UTF8');
    // 查询任务列表
    $result = mysqli_query($conn,"SELECT * FROM project_detail WHERE id=$tid");    
    $data = [];
    // 遍历后添加进入
    while ($d = mysqli_fetch_array($result)) {
       array_push($data, $d);
    }
 }
 ?>



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>task-details</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/task-details.css">
    <link rel="stylesheet" href="../css/simditor.css">
    

</head>
<body>
<div>
    <header></header>
    <div class="content">
        <div class="c_top">
            <div class="c_top_c">123</div>
        </div>
    </div>
    
    <div class="c_content">
        <div class="c_content_wrap">
            <div class="wrap_top">
                <span class="span1"></span>
                <?php foreach ($data as $d) { ?> 
                <span class="span2"><?php echo($d['t_name']) ?></span>
                <?php } ?> 
            </div>
            <div class="wrap_foot">
                添加 <a href="#" id="show_simditor">任务描述</a> 或者 <a href="#">检查项</a>
            </div>
        </div>
        
        <div class="wrap_input">
            <div class="input_top">
                <span class="span3"></span>
                <?php foreach ($data as $d) { ?> 
                <span class="span4"><?php echo($d['t_name']) ?></span>
                <?php } ?> 
                <span class="span5"><a href="#">未指派~没有截止时间</a></span>
            </div>
            <div class="input_content">

                <textarea placeholder="任务描述" id="editor" name="editor" autofocus></textarea>
            </div>
            <div class="input_bottom">
                <span class="span6">保存修改</span>
                <span class="span7">取消</span>
                <span class="span8"></span>
            </div>
        </div>
        <div class="wrap_content">
            <p class="create">
                <img style="width:23px;vertical-align: bottom;" src="../images/tadd.png" alt="">
                <span>03-02 21:22 &nbsp;&nbsp;&nbsp;&nbsp;123&nbsp;&nbsp;创建了任务</span>
            </p>
            <p class="comment">
                <span><img src="../images/photo.jpg" alt=""></span>
                <span>
                    <input type="text" placeholder="点击发表评论">
                    <textarea style="display:none" placeholder="任务描述" id="editor" name="editor" autofocus></textarea>
                </span>
            </p>
        </div>
        

        <div class="nav1">
            <ul class="nav1_ul">
                <li><a class="nav1_ul-a" href="#">关注</a></li>
                <li><a class="nav1_ul-a" href="#">编辑</a></li>
                <li><a class="nav1_ul-a" href="#">复制</a></li>
                <li><a class="nav1_ul-a" href="#">移动</a></li>
                <li ><a class="nav1_ul-last_a" href="#">删除</a></li>
            </ul>
        </div>
    </div>
</div>
<script src="../js/jquery-3.1.1.js"></script>
<script src="../js/common.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="../js/module.min.js"></script>
<script src="../js/hotkeys.min.js"></script>
<script src="../js/uploader.min.js"></script>
<script src="../js/simditor.min.js"></script>
<script src="../js/task-details.js"></script>
</body>
</html>